<template>
  <div id="theme">
    <img src="../../img/practice/导航插画.png" alt="" style="width: 100%" />
    <div class="title">Hello,早上好</div>
    <div class="data">每天坚持一点 进步一点</div>
    <div id="background">
      <div class="navBox">
        <ul @click="SetBtn">
          <img src="../../img/practice/背景更改.png" alt="" />
          <div>背景更改</div>
        </ul>
        <ul @click="PopoutBtn">
          <img src="../../img/practice/打卡签到.png" alt="" />
          <div>早晚打卡</div>
        </ul>
        <ul @click="xuebaMode">
          <img src="../../img/practice/学霸模式.png" alt="" />
          <div>学霸模式</div>
        </ul>
      </div>
      <!-- 导航 -->
      <div class="nav">
        <span class="side"></span>
        <li class="navLi">今日练习</li>
        <li @click="allPractice" class="btnLi">查看所有</li>
        
      </div>
      <!-- 练习列表 -->
      <div class="ListDiv">
        <ul>
          <img src="../../img/practice/新建-.png" alt="" />
          <li>
            <p>视频学习</p>
            <span class="timer">00m</span>
            <span>1次计时</span>
          </li>
        </ul>
        <ul>
          <img src="../../img/practice/新建-.png" alt="" />
          <li>
            <p>视频学习</p>
            <span class="timer">00m</span>
            <span>1次计时</span>
          </li>
        </ul>
        <ul>
          <img src="../../img/practice/新建-.png" alt="" />
          <li>
            <p>视频学习</p>
            <span class="timer">00m</span>
            <span>1次计时</span>
          </li>
        </ul>
      </div>
    </div>
    <!-- 学霸模式右弹框 -->
        <rightPop @closePop="close" :isShow="flag1"><div id="xueba">
            <span>学霸模式设置</span>
            <div class="main-content">
              <div class="content">
                <div>
                  <p>
                    <span>学霸模式</span>
                    <a href="">
                      <img src="../../img/practice/开关-关.png" alt="" />
                    </a>
                  </p>
                </div>
                <div>
                  <p>
                    <span>督促模式</span>
                    <a href="">
                      <img src="../../img/practice/开关-关.png" alt="" />
                    </a>
                  </p>
                </div>
              </div>
            </div>
          </div>
        </rightPop>
        <!-- 所有练习右弹框 -->
        <rightPop @closeP='close' :isAll="flag2" id="allPractice">
          <div>
            <span id="spanTitle">全部练习</span>
            <van-tabs class="practice-title" v-model="active">
              <van-tab class="" title="所有">
                <ul>
                  <li v-for="(v, i) in allPracticeList" :key="i + 1">
                    <img :src="v.img" alt="" />
                    <p>{{ v.title }}</p>
                    <p>
                      <span>练习频率:{{ v.rate }}</span>
                      <span>{{ v.days }}天</span>
                    </p>
                  </li>
                </ul>
              </van-tab>
              <van-tab title="进行中">暂无练习</van-tab>
              <van-tab title="暂停中">暂无练习</van-tab>
              <van-tab title="已完成">暂无练习</van-tab>
            </van-tabs>
          </div>
        </rightPop>
    <Clock></Clock>
    <PopUp />
    <Background />
  </div>
</template>

<script>
import axios from "../../request/zhoutong-http";
import Clock from "../../components/practice/Clock.vue";
import PopUp from "../../components/practice/PopUp.vue";
import Background from "../../components/practice/Background";
import rightPop from "../../components/practice/Right-pop.vue";
import { mapState, mapMutations, mapGetters, mapActions } from "vuex";
export default {
  components: { Clock, PopUp, rightPop, Background },
  computed: {
    ...mapState("zhoutong", ["allPracticeList"]),
  },
  data() {
    return {
      show: false,
      Clockshow: true,
      time: "",
      BackgroudShow: true,
      active: 0,
      flag1:false,
      flag2:false,
    };
  },
  methods: {
    close(flag){
      this.flag1=flag
      this.flag2=flag
    },
    xuebaMode() {
      this.flag1=true
    },
    allPractice() {
      this.flag2=true
    },
    PopoutBtn() {
      this.time = String(new Date()).slice(16, 18);
      this.$bus.$emit("Clockshow", this.Clockshow, this.time);
    },
    SetBtn() {
      this.$bus.$emit("BackgroudShow", this.BackgroudShow);
    },
    
  },
};
</script>

<style lang="scss">
#allPractice {
  #spanTitle{
    text-align: center;
    display: block;
    line-height: 60px;
    width: 750px;
    height: 60px;
    font-size: 36px;
    font-family: PingFang SC;
    font-weight: 500;
    color: #000000;
    background-color: #ffffff;
  }
  .practice-title {
    .van-tab {
      font-size: 24px !important;
      line-height: 30px;
    }
    ul {
      box-sizing: border-box;
      padding: 40px;
      background-color: #f4f4f4;
      height: 1514px;
      li {
        background-color: #fff;
        margin-bottom: 24px;
        width: 100%;
        height: 144px;
        padding: 20px;
        border: 1px solid transparent;
        box-sizing: border-box;
        border-radius: 10px;
        img {
          float: left;
          width: 100px;
          height: 100px;
        }
        p {
          margin-left: 117px;
        }
        p:nth-of-type(2) {
          margin-top: 28px;
          span:nth-of-type(2) {
            float: right;
          }
        }
      }
    }
  }
}
#xueba {
  margin-top: 0;
  .main-content {
    width: 750px;
    height: 1564px;
    background: #f4f4f4;
    margin-top: 0;
    padding-top: 24px;
    box-sizing: border-box;
    .content {
      width: 750px;
      height: 535px;
      background: #ffffff;
      border-radius: 20px;
      div {
        margin-top: 0;
        width: 750px;
        height: 239px;
        padding: 50px;
        box-sizing: border-box;
        P {
          text-align: left;
          a {
            float: right;
          }
        }
      }
    }
  }
  > span {
    text-align: center;
    display: block;
    line-height: 60px;
    width: 750px;
    height: 60px;
    font-size: 36px;
    font-family: PingFang SC;
    font-weight: 500;
    color: #000000;
    background-color: #ffffff;
  }
}
#theme {
  width: 750px;
  height: 1624px;
  background: #f4f4f4;
}
.title {
  width: 280px;
  height: 48px;
  font-size: 48px;
  font-family: PingFang SC;
  font-weight: 500;
  color: #fefefe;
  position: absolute;
  left: 33px;
  top: 146px;
}
.data {
  width: 178px;
  height: 65px;
  font-size: 30px;
  font-family: PingFang SC;
  font-weight: 500;
  color: #fefefe;
  position: absolute;
  left: 33px;
  top: 232px;
}
.navBox {
  width: 686px;
  height: 266px;
  background: #ffffff;
  border-radius: 10px;
  position: absolute;
  left: 47px;
  top: 433px;
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  ul {
    text-align: center;
    img {
      width: 90px;
    }
  }
}
.navBox div {
  margin-top: 38px;
  width: 133px;
  height: 29px;
  font-size: 30px;
  font-family: PingFang SC;
  font-weight: 500;
  color: #333333;
}
.nav {
  display: flex;
  margin-top: 331px;
  margin-bottom: 58px;
  height: 34px;
  padding: 0 33px;
}
.side {
  width: 4px;
  height: 40px;
  background: #50c758;
  border-radius: 2px;
  margin-left: 32px;
  margin-right: 12px;
}
.navLi {
  width: 154px;
  height: 34px;
  font-size: 36px;
  font-family: PingFang SC;
  font-weight: 500;
  color: #333333;
}
.btnLi {
  margin-left: 346px;
  width: 130px;
  height: 46px;
  border: 1px solid #999999;
  border-radius: 8px;
  color: #999999;
  font-size: 24px;
  font-family: PingFang SC;
  font-weight: 400;
  text-align: center;
  line-height: 46px;
}
.ListDiv {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.ListDiv ul {
  display: flex;
  width: 654px;
  height: 144px;
  background: #ffffff;
  border-radius: 10px;
  margin-bottom: 24px;
}
.ListDiv ul img {
  width: 100px;
  height: 100px;
  margin-top: 21px;
}
.ListDiv li p {
  width: 131px;
  height: 28px;
  font-size: 30px;
  font-family: PingFang SC;
  font-weight: 500;
  color: #333333;
  margin-top: 21px;
  margin-bottom: 30px;
}
.ListDiv li span {
  font-size: 24px;
  font-family: PingFang SC;
  font-weight: 500;
  color: #999999;
}
.ListDiv li .timer {
  margin-right: 47px;
}
</style>
